package sealed_generator;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.*;

import sealed_generator.card.Card;

@SuppressWarnings("serial")
public class SealedGeneratorWebServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("Hello, world");
		KeyFileReader keyFile=new KeyFileReader();
		String[] setInfo=keyFile.getSetInfo("New Phyrexia");
		Set theSet=MWSPatchReader.read(
				setInfo[1], setInfo[0], setInfo[2], setInfo[3]);
		try {
			List<Card> pack=theSet.generatePack();
			System.out.println(pack);
			for(Card card: pack){
				resp.getWriter().println(card);
			}
		} catch (SetFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
